import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by Zhang Fan on 2015/8/27.
 */
public class ServerInstance {
    public static void main(String[] args) {
        try {
            Socket clientSocket;
            ServerSocket serverSocket=new ServerSocket(9001);
            while (true){
                clientSocket = serverSocket.accept();
                new Thread(new InputThread(clientSocket)).start();
                new Thread(new OutThread(clientSocket)).start();
                System.out.println("srv rvn....");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
